<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文本省略号</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            border: 1px solid #333;
            overflow:hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
        .container{
            width: 100px;
            height: 100px;
            border: 1px solid #333;
            overflow:hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 4;
        }
    </style>
</head>

<body>
    <div class="box">
        我要好好复习，也没有几天时间.几天的时间决定salary
    </div>
    <div class="container">
        我要好好复习，也没有几天时间.几天的时间决定salary
    </div>
</body>
</html>